<?php


namespace app\admin\controller;


use think\Controller;
use think\facade\Request;

class MiniApp extends Controller
{
    protected $middleware = [
        'app\http\middleware\checkAdminToken::class'
    ];


    //设置
    public function setting()
    {
        $data = Request::only(['name', 'code','desc', 'logo','classify', 'vip', 'android', 'ios', 'user_rate','vip_rate', 'lv_1_rate', 'lv_2_rate', 'wx_appid', 'wx_secret', 'tt_appid', 'tt_secret', 'wx', 'tt', 'status', 'views']);
//        $data['code'] = 'movie';
        //设置查剧名的资料
        \app\common\model\MiniApp::setAppData($data['code'], $data);
        $this->result($data, 200, '成功');
    }


    public function settingRead()
    {
        $code=Request::param('code');
        $data= \app\common\model\MiniApp::where('code',$code)->find();
        $this->result($data, 200, '成功');
    }




}
